package com.zzyk.main.mapper;

import com.zzyk.main.model.pojo.DeviceElectricityDay;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;

@Mapper
public interface DeviceElectricityDayMapper {
    /**
     * delete by primary key
     *
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(DeviceElectricityDay record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(DeviceElectricityDay record);

    /**
     * select by primary key
     *
     * @param id primary key
     * @return object by primary key
     */
    DeviceElectricityDay selectByPrimaryKey(Integer id);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(DeviceElectricityDay record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(DeviceElectricityDay record);

    /**
     * 获取企业下所有设备用电统计
     *
     * @param enterprise
     * @param month      月份
     * @param bDate
     * @param deviceList
     * @return
     */
    DeviceElectricityDay selectOverviewOfEnergyUse(@Param("enterprise") Integer enterprise, @Param("month") String month, @Param("bDate") Date bDate, @Param("deviceList") Integer[] deviceList);

    /**
     * 根据设备查询当天能耗信息
     *
     * @param deviceId
     * @return
     */
    DeviceElectricityDay selectDyDeviceIdToDay(Integer deviceId);


    void updateByClientId(DeviceElectricityDay electricityDay);
}